/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package verins.beans;

import java.io.Serializable;
import java.util.Date;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author hectdx
 */
@Entity
@Table(name = "partidopolitico", schema = "verinscribe")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Partidopolitico.findAll", query = "SELECT p FROM Partidopolitico p"),
    @NamedQuery(name = "Partidopolitico.findByIdpartidopolitico", query = "SELECT p FROM Partidopolitico p WHERE p.idpartidopolitico = :idpartidopolitico"),
    @NamedQuery(name = "Partidopolitico.findByNombre", query = "SELECT p FROM Partidopolitico p WHERE p.nombre = :nombre"),
    @NamedQuery(name = "Partidopolitico.findByRuc", query = "SELECT p FROM Partidopolitico p WHERE p.ruc = :ruc"),
    @NamedQuery(name = "Partidopolitico.findByDireccion", query = "SELECT p FROM Partidopolitico p WHERE p.direccion = :direccion"),
    @NamedQuery(name = "Partidopolitico.findByTelefonos", query = "SELECT p FROM Partidopolitico p WHERE p.telefonos = :telefonos"),
    @NamedQuery(name = "Partidopolitico.findByEmail", query = "SELECT p FROM Partidopolitico p WHERE p.email = :email"),
    @NamedQuery(name = "Partidopolitico.findByFecharegistro", query = "SELECT p FROM Partidopolitico p WHERE p.fecharegistro = :fecharegistro"),
    @NamedQuery(name = "Partidopolitico.findByEstado", query = "SELECT p FROM Partidopolitico p WHERE p.estado = :estado")})
public class Partidopolitico implements Serializable {
    @Basic(optional =     false)
    @Column(name = "fecharegistro")
    @Temporal(TemporalType.DATE)
    private Date fecharegistro;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "idpartidopolitico")
    private List<Padronelectoral> padronelectoralList;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "idpartidopolitico")
    private List<Persona> personaList;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "partidopolitico")
    private List<Partidopoliticoxprocesoelectoral> partidopoliticoxprocesoelectoralList;
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "idpartidopolitico", nullable = false)
    @GeneratedValue(generator="verinscribe.partidopolitico_idpartidopolitico_seq",strategy=GenerationType.IDENTITY)
    private Integer idpartidopolitico;
    @Basic(optional = false)
    @Column(name = "nombre", nullable = false, length = 100)
    private String nombre;
    @Basic(optional = false)
    @Column(name = "ruc", nullable = false, length = 20)
    private String ruc;
    @Column(name = "direccion", length = 200)
    private String direccion;
    @Column(name = "telefonos", length = 200)
    private String telefonos;
    @Column(name = "email", length = 100)
    private String email;
    @Basic(optional = false)
    @Column(name = "estado", nullable = false, length = 50)
    private String estado;
    @JoinColumn(name = "idtipopartidopolitico", referencedColumnName = "idtipopartidopolitico", nullable = false)
    @ManyToOne(optional = false)
    private Tipopartidopolitico idtipopartidopolitico;

    public Partidopolitico() {
    }

    public Partidopolitico(Integer idpartidopolitico) {
        this.idpartidopolitico = idpartidopolitico;
    }

    public Partidopolitico(Integer idpartidopolitico, String nombre, String ruc, Date fecharegistro, String estado) {
        this.idpartidopolitico = idpartidopolitico;
        this.nombre = nombre;
        this.ruc = ruc;
        this.fecharegistro = fecharegistro;
        this.estado = estado;
    }

    public Integer getIdpartidopolitico() {
        return idpartidopolitico;
    }

    public void setIdpartidopolitico(Integer idpartidopolitico) {
        this.idpartidopolitico = idpartidopolitico;
    }

    public String getNombre() {
        return nombre;
    }

    public void setNombre(String nombre) {
        this.nombre = nombre;
    }

    public String getRuc() {
        return ruc;
    }

    public void setRuc(String ruc) {
        this.ruc = ruc;
    }

    public String getDireccion() {
        return direccion;
    }

    public void setDireccion(String direccion) {
        this.direccion = direccion;
    }

    public String getTelefonos() {
        return telefonos;
    }

    public void setTelefonos(String telefonos) {
        this.telefonos = telefonos;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getEstado() {
        return estado;
    }

    public void setEstado(String estado) {
        this.estado = estado;
    }

    public Tipopartidopolitico getIdtipopartidopolitico() {
        return idtipopartidopolitico;
    }

    public void setIdtipopartidopolitico(Tipopartidopolitico idtipopartidopolitico) {
        this.idtipopartidopolitico = idtipopartidopolitico;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idpartidopolitico != null ? idpartidopolitico.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Partidopolitico)) {
            return false;
        }
        Partidopolitico other = (Partidopolitico) object;
        if ((this.idpartidopolitico == null && other.idpartidopolitico != null) || (this.idpartidopolitico != null && !this.idpartidopolitico.equals(other.idpartidopolitico))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "verins.beans.Partidopolitico[ idpartidopolitico=" + idpartidopolitico + " ]";
    }

    @XmlTransient
    public List<Partidopoliticoxprocesoelectoral> getPartidopoliticoxprocesoelectoralList() {
        return partidopoliticoxprocesoelectoralList;
    }

    public void setPartidopoliticoxprocesoelectoralList(List<Partidopoliticoxprocesoelectoral> partidopoliticoxprocesoelectoralList) {
        this.partidopoliticoxprocesoelectoralList = partidopoliticoxprocesoelectoralList;
    }

    @XmlTransient
    public List<Padronelectoral> getPadronelectoralList() {
        return padronelectoralList;
    }

    public void setPadronelectoralList(List<Padronelectoral> padronelectoralList) {
        this.padronelectoralList = padronelectoralList;
    }

    @XmlTransient
    public List<Persona> getPersonaList() {
        return personaList;
    }

    public void setPersonaList(List<Persona> personaList) {
        this.personaList = personaList;
    }

    public Date getFecharegistro() {
        return fecharegistro;
    }

    public void setFecharegistro(Date fecharegistro) {
        this.fecharegistro = fecharegistro;
    }
    
}
